count triplets hackerrank solution

visit shbcf.ru